<script type="text/javascript" src="./scripts/jquery.min.js"></script>
<script type="text/javascript">
	$(document).ready(function() {
		$("dd").hide();
		$("dt").css("cursor", "pointer");
		$("dt").click(function() {
			$("dd").slideUp();
			$(this).next().slideDown();
		});
	});
</script>

<?php

	$req = $bdd->query('SELECT * FROM faq_categories');

	while ($donnees = $req->fetch())
	{
		echo '<h1>'.$donnees['nom'].'</h1>';
		?> <dl> <?php
		$req_que = $bdd->prepare('SELECT * FROM faq_questions WHERE id_categories=:id');
		$req_que->execute(array('id' => $donnees['id']));
		while ($donnees_que = $req_que->fetch())
		{
			echo '<dt>'.$donnees_que['questions'].'</dt>';
			echo '<dd>'.$donnees_que['reponses'].'</dd>';
		}
		?> </dl> <?php
	}
	$req->closeCursor();

?>